var cut[Ncat-1];

model {
  for (i in 1:N){
    y[i] ~ dnorm(mu[i], 1)
    mu[i] <- b.county[countyID[i]] + b.1*chgUnemp1615[i] + b.2*avgUnemp16[i] + b.3*chgInc1615[i]+ b.4*inc16[i] + b.5*younger30[i]+  b.6*older65[i] + b.7*female[i] + b.8*black[i] + b.9*latino[i] + b.10*noHighSchool[i] + b.11*HighSchool[i] + b.12*someCollege[i] + b.13*fourCollege[i] + b.14*income[i] + b.15*unemployed[i] + b.16*fullTime[i] + b.17*partTime[i] + b.18*ownHome[i] + b.19*newsInt[i] + b.20*ideol[i] + b.21*Dem[i] + b.22*Rep[i] + b.23*Ind[i]
    for (k in 1:(Ncat-1)) { logit(Q[i,k]) <- cut[k] - mu[i]}
    p[i, 1] <- Q[i,1]
    for (k in 2:(Ncat-1)){ p[i,k] <- Q[i,k] - Q[i, (k-1)]}
    p[i, Ncat] <- 1 - Q[i, (Ncat-1)]
  }
  for (j in 1:Ncounty){
    b.county[j] ~ dnorm(mu.county, tau.county)
  }
  mu.county ~ dnorm(0, 0.0001)
  tau.county <- pow(sigma.county, -2)
  sigma.county ~ dunif(0, 1000)
  b.1 ~ dnorm(0, 0.0001)
  b.2 ~ dnorm(0, 0.0001)
  b.3 ~ dnorm(0, 0.0001)
  b.4 ~ dnorm(0, 0.0001)
  b.5 ~ dnorm(0, 0.0001)
  b.6 ~ dnorm(0, 0.0001)
  b.7 ~ dnorm(0, 0.0001)
  b.8 ~ dnorm(0, 0.0001)
  b.9 ~ dnorm(0, 0.0001)
  b.10 ~ dnorm(0, 0.0001)
  b.11 ~ dnorm(0, 0.0001)
  b.12 ~ dnorm(0, 0.0001)
  b.13 ~ dnorm(0, 0.0001)
  b.14 ~ dnorm(0, 0.0001)
  b.15 ~ dnorm(0, 0.0001)
  b.16 ~ dnorm(0, 0.0001)
  b.17 ~ dnorm(0, 0.0001)
  b.18 ~ dnorm(0, 0.0001)
  b.19 ~ dnorm(0, 0.0001)
  b.20 ~ dnorm(0, 0.0001)
  b.21 ~ dnorm(0, 0.0001)
  b.22 ~ dnorm(0, 0.0001)
  b.23 ~ dnorm(0, 0.0001)
  
    for (k in 1: (Ncat-1)){
      cut[k] ~ dt(0, 1, 5)
    }
}